import Vue from 'vue'
import VueRouter from 'vue-router'
import bill from "@/views/orders/bill.vue";
import SettlementPage from '../views/index/finance/settlementPage.vue'
import Housekeeping from '../views/index/finance/housekeeping.vue'
import Payableon from '../views/index/finance/payableon.vue'
import orderDetail from "@/views/orders/orderDetail.vue";

Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    name: 'home',
    component: () => import( '../views/login/login.vue')
  },
  {
    path: '/',    //前端允许默认打开这个页面
    component: () => import( '../components/Manage.vue'),   //就是这个组装默认页面
    redirect:"/index", //加载组装默认页面时候。侧边栏和顶部是固定有了，而主体部分等待灵活嵌套，这里主体部分默认加载用户user界面    
    children:[
      {path: '/index', name: '首页', component: () => import( '../views/index/index.vue')}, //为了和侧边栏挂钩上，path和侧边栏页面那边的index里面对应
      {path: '/userInfo', name: '个人信息页', component: () => import( '../views/login/userInfo.vue')},
      {path: '/updatePassword', name: '修改密码页', component: () => import( '../views/login/updatePassword.vue')},
      {path: '/monitor', name: '在途监控', component: () => import( '../views/monitor/monitor.vue')},
      {path: '/client', name: '客户管理', component: () => import( '../views/foundation/client.vue')},
      {path: '/Waybill', name: '运单', component: () => import( '../views/OperationsManagement/Waybill.vue')},
      {path: '/PickupOrder', name: '提货单', component: () => import( '../views/OperationsManagement/PickupOrder.vue')},
      {path: '/Destination', name: '到站', component: () => import( '../views/OperationsManagement/Destination.vue')},
      {path: '/Receipt', name: '签收单', component: () => import( '../views/OperationsManagement/Receipt.vue')},
      {path: '/ReturnReceipt', name: '回单', component: () => import( '../views/OperationsManagement/ReturnReceipt.vue')},
      {path: '/order', name: '订单', component: () => import( '../views/orders/order.vue')},
      {path: '/bill', name: '开单', component: () => import( '../views/orders/bill.vue')},
        {path: '/order/bill', name: 'bill', component: bill},
        {path: '/order/orderDetail', name: 'orderDetail', component: orderDetail},
        {path: '/delivery', name: '订单统计', component: () => import( '../views/statisticaltion/delivery.vue')}, //为了和侧边栏挂钩上，path和侧边栏页面那边的index里面对应
        {path: '/performance', name: '司机业绩统计', component: () => import( '../views/statisticaltion/performance.vue')}, //为了和侧边栏挂钩上，path和侧边栏页面那边的index里面对应
        {path: '/transport', name: '异常统计', component: () => import( '../views/statisticaltion/transport.vue')}, //为了和侧边栏挂钩上，path和侧边栏页面那边的index里面对应
      {path: '/carriers', name: '承运商管理', component: () => import('../views/foundation/carriers.vue')},
      {path: '/driver', name: '司机管理', component: () => import('../views/foundation/driver.vue')},
      {path: '/vehicle', name: '车辆管理', component: () => import('../views/foundation/vehicle.vue')},
      {path: '/address', name: '地址管理', component: () => import('../views/foundation/address.vue')},
      {path: '/goods', name: '货物管理', component: () => import('../views/foundation/goods.vue')},
    ]
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
